<?php

class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
    /*public function _initFrontController()
    {
        $front = Zend_Controller_Front::getInstance();
        $front->setControllerDirectory( array (
            'default' => APPLICATION_PATH . '/modules/default/controllers',
            'cd' => APPLICATION_PATH . '/modules/cd/controllers',
            'book' => APPLICATION_PATH . '/modules/book/controllers',
            'blog' => APPLICATION_PATH . '/modules/blog/controllers',
        ));        
        return $front;
    }*/
    
    public function _initAutoload()
    {
        // Each module needs to be registered... 
        $modules = array(            
            'default',
            //'cd',
            //'book',
            //'blog',
        );

        foreach ($modules as $module) {
            $autoloader = new Zend_Application_Module_Autoloader(array(
                'namespace' => ucfirst($module),
                'basePath'  => APPLICATION_PATH . '/modules/' . strtolower($module),
            ));
        }        
        return $autoloader;
    }
    
    /*protected function _initView()
    {        
        // Initialize view
        $view = new Zend_View();

        // Add view helper path
        $view->addHelperPath(
            APPLICATION_PATH . '/modules/blog/views/helpers',
            'Blog_View_Helper'
        );

        // Add the view to the ViewRenderer
        $viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper(
            'ViewRenderer'
        );
        $viewRenderer->setView($view);
        
        // Return it, so that it can be stored by the bootstrap
        return $view;                 
    }*/
    
    protected function _initView()
    {
        $view = new Zend_View;
        $view->addHelperPath('Blog/View/Helper');
        $viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper(
            'ViewRenderer'
        );
        $viewRenderer->setView($view);
        
        // Return it, so that it can be stored by the bootstrap
        return $view;
    }

}

